#!/usr/bin/env python3
# -*- coding:utf-8 -*-
# @Author: renjin@bit.edu.cn
# @Date  : 2024-10-04

from spirecv.dataloader.SpireFormatReaderNode import SpireFormatReaderNode
from spirecv.evaluator.COCOResultAssembleNode import COCOResultAssembleNode
from spirecv.evaluator.COCOEvalNode import COCOEvalNode
import time


job_name = 'detection_evaluation'
parameter_file = '../../params/spirecv2/default_params.json'


dataloader = SpireFormatReaderNode(job_name, param_dict_or_file=parameter_file)
assemble = COCOResultAssembleNode(job_name, param_dict_or_file=parameter_file,
                                  specified_input_topic='/' + job_name + '/gt/results',
                                  launch_next_emit=True)
evaluator = COCOEvalNode(job_name, param_dict_or_file=parameter_file,
                         sms_shutdown_emit=True)
dataloader.launch_next()
